import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)


const manage = r => require.ensure([], () => r(require('@/page/manage')), 'manage');
const monitor = r => require.ensure([], () => r(require('@/page/monitor')), 'monitor');
const switchInfo = r => require.ensure([], () => r(require('@/page/switchInfo')), 'switchInfo');
const historicalPortInfo = r => require.ensure([], () => r(require('@/page/historicalPortInfo')), 'historicalPortInfo');
const historicalProtocolInfo = r => require.ensure([], () => r(require('@/page/historicalProtocolInfo')), 'historicalProtocolInfo');
const connDevInfo = r => require.ensure([], () => r(require('@/page/connDevInfo')), 'connDevInfo');
const protocolInfo= r => require.ensure([], () => r(require('@/page/protocolInfo')), 'protocolInfo');


const routes = [
	{
		path: '/',
		component: manage
	},
	{
		path: '/manage',
		component: manage,
		name: '',
		children: [{
			path: '',
			component: switchInfo,
			meta: [],
		},{
			path: '/monitor',
			component: monitor,
		},{
			path: '/historicalPortInfo',
			component: historicalPortInfo,
		}, {
			path: '/connDevInfo',
			component: connDevInfo,
		},{
		    path:'/protocolInfo',
            component:protocolInfo,
        },{
			path: '/historicalProtocolInfo',
			component: historicalProtocolInfo,
		}]
	}
]

export default new Router({
	mode: 'history',
	routes: routes,
	strict: process.env.NODE_ENV !== 'production',
})
